find_package(benchmark QUIET)

if (NOT benchmark_FOUND)
	set(BENCHMARK_ENABLE_TESTING OFF CACHE INTERNAL "" FORCE)
	set(BENCHMARK_DOWNLOAD_DEPENDENCIES OFF CACHE INTERNAL "" FORCE)
	set(BENCHMARK_ENABLE_ASSEMBLY_TESTS OFF CACHE INTERNAL "" FORCE)
	set(BENCHMARK_ENABLE_EXCEPTIONS ON CACHE INTERNAL "" FORCE)
	set(BENCHMARK_ENABLE_INSTALL OFF CACHE INTERNAL "" FORCE)
	set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE INTERNAL "" FORCE)
	set(BENCHMARK_BUILD_32_BITS OFF CACHE INTERNAL "" FORCE)
	set(BENCHMARK_ENABLE_LTO OFF CACHE INTERNAL "" FORCE)
	set(BENCHMARK_USE_LIBCXX OFF CACHE INTERNAL "" FORCE)
	add_subdirectory(third_party/benchmark)
	mark_as_advanced(benchmark_DIR)
	mark_as_advanced(LIBRT)
	mark_as_advanced(LLVM_FILECHECK_EXE)
endif()

add_executable(kangaru_benchmarks src/benchmarks.cpp)
target_link_libraries(kangaru_benchmarks PRIVATE kangaru::kangaru)
target_compile_features(kangaru_benchmarks PRIVATE cxx_std_11)
target_link_libraries(kangaru_benchmarks PRIVATE benchmark)
